input {
    file {
        type => "lumen_log"
        path => ["/var/log/lumen/*.log"]
        start_position => "beginning"
        exclude => "*.gz"
    }
}

filter {
    if [type] == "php_lumen_log" {
        grok {
            patterns_dir => "/etc/logstash/patterns.d"
            match => {
                "message" => "%{PHP_LUMEN_LOG}"
            }
        }
    }

    mutate {
            remove_field =>["message"]
            remove_field =>["@timestamp"]
            remove_field =>["path"]
    }
}

output {
    if [type] == "lumen_log" {
        elasticsearch {
            hosts => ["{{ monitor_ip }}:9200"]
            index => "lumen-log"
        }
    }
}
